package com.woniu.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.woniu.entity.MenuEntity;
import com.woniu.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/pagenationTest")
public class PagenationTestController extends BaseController {
    @Autowired
    IMenuService iMenuService;

    @Log(title = "测试方法", businessType = BusinessType.INSERT)
    @PreAuthorize("@ss.hasPermi('test:pagenation')")
    @GetMapping("/allMenu")
    public TableDataInfo allMenus(){
        startPage();
        List<MenuEntity> allMenus = iMenuService.findAllMenus();
        return getDataTable(allMenus);
    }
}
